package com.sokal.easycare.modules.picture.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sokal.easycare.common.service.TreeService;
import com.sokal.easycare.common.utils.StringUtils;
import com.sokal.easycare.modules.picture.entity.PicCategory;
import com.sokal.easycare.modules.picture.dao.PicCategoryDao;

/**
 * 图文栏目Service
 * @author liliangdong
 * @version 2017-03-22
 */
@Service
@Transactional(readOnly = true)
public class PicCategoryService extends TreeService<PicCategoryDao, PicCategory> {

	public PicCategory get(String id) {
		return super.get(id);
	}
	
	public List<PicCategory> findList(PicCategory picCategory) {
		if (StringUtils.isNotBlank(picCategory.getParentIds())){
			picCategory.setParentIds(","+picCategory.getParentIds()+",");
		}
		return super.findList(picCategory);
	}
	
	@Transactional(readOnly = false)
	public void save(PicCategory picCategory) {
		super.save(picCategory);
	}
	
	@Transactional(readOnly = false)
	public void delete(PicCategory picCategory) {
		super.delete(picCategory);
	}
	
}